let vm = new Vue({
    el: '#app',
    data:{
        seconds: 0,
        counter: 0
    },
    mounted: function () {
        //ES5实现
        var that = this;
        setInterval(function(){
            that.seconds++;
        }, 1000)

        //ES6实现
        this.$interval = setInterval(() => {
           this.counter++;
            console.log('Time');
        }, 1000)
    },
    destroyed: function () {
        clearInterval(this.$interval);
    }

});